---
import globalData from "../../../build/data/index.mjs"

const {
  childpage = false,
  backtotop = false,
  bodyClass = "bg-body-tertiary py-3",
} = Astro.props

const { keywords, description, author, title } = globalData
---

<!doctype html>
<html
  lang="zh"
  data-lts-toggle={backtotop ? "backtotop" : false}
  data-overlayscrollbars-initialize={childpage}
>
  <head>
    <meta charset="utf-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, user-scalable=no"
    />
    <link
      rel="icon"
      href="assets/img/favicon-16x16.svg"
      sizes="32x32"
      type="image/svg+xml"
    />
    <link
      rel="icon"
      href="assets/img/favicon-16x16.svg"
      sizes="16x16"
      type="image/svg+xml"
    />
    <meta name="keywords" content={keywords} />
    <meta name="description" content={description} />
    <meta name="author" content={author} />
    <!--核心css依赖-->
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"
    />
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
    />
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/overlayscrollbars@2.7.3/styles/overlayscrollbars.min.css"
    />
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.css"
    />

    <slot name="stylesheet" />

    <link rel="stylesheet" href="css/adminlts.min.css" />

    <slot name="title">
      <title>{title}</title>
    </slot>

    <slot name="css" />
  </head>

  <body
    class={bodyClass}
    data-lts-toggle={childpage ? "scrollbar" : false}
    data-overlayscrollbars-initialize={childpage}
  >
    <slot />
    <!--核心依赖-->
    <script
      is:inline
      src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js"
    ></script>
    <script
      is:inline
      src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js"
    ></script>
    <script
      is:inline
      src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"
    ></script>
    <script
      is:inline
      src="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js"
    ></script>
    <script
      is:inline
      src="https://cdn.jsdelivr.net/npm/overlayscrollbars@2.7.3/browser/overlayscrollbars.browser.es6.min.js"
    ></script>

    <!--当前页面的依赖-->
    <slot name="script" />
    <!--adminlts核心js文件-->
    <script is:inline src="js/adminlts.js"></script>
    <!--全局设置-->
    <script is:inline src="js/adminlts.common.js"></script>
    <!--假数据模拟,生产环境中请直接删除该js(否则会影响您的ajax请求功能)-->
    <script
      is:inline
      src="https://cdn.jsdelivr.net/npm/mockjs@1.1.0/dist/mock.min.js"></script>
    <script is:inline src="js/adminlts.mock.js"></script>
    <slot name="js" />
  </body>
</html>
